home *** CD-ROM | disk | FTP | other *** search
/ Your Web Site Creator / Your Web Site Creator.iso / WebSite / data1.cab / Program_Executable_Files / scripts / PICTURE.DAT < prev    next >
Encoding:
Text File  |  1999-01-13  |  10.1 KB  |  399 lines

  1. ; PICTURE.DAT
  2. [GetPhotoCollectionData]
  3. ; prior to calling, set the following temporary variables
  4. ;    nPicturesVar = name of variable to hold number of picture
  5. ;    pictureNameRoot = root of picture names, see example
  6. ;       pictureCaptionRoot = root of picture captions, see example
  7. ; for example,
  8. ;   SETTEMP nPicturesVar = "nNewletterPictures"
  9. ;   SETTEMP pictureNameRoot = "newsPix"
  10. ;   SETTEMP pictureCaptionRoot = "newsPixText"
  11. ;   SETTEMP styleVar = "newsAlbumStyle"
  12. ;   GOSUB GetPhotoCollectionData
  13. ;
  14. ; then on return from the routine, the variable nNewletterPictures will
  15. ; contain the number of pictures, the picture names will be in
  16. ; variables newsPix1, newsPix2, newsPix3, etc, and the album style (1|2|3)
  17. ; will be in the variable newsAlbumStyle.
  18.  
  19. SETTEMP GPCDalbumStyle = eval( styleVar )
  20. SETTEMP GPCDnPictures = eval( nPicturesVar )
  21.  
  22. SETTEMP pxprmpt1 = "Select the "
  23. SETTEMP pxprmpt2 = " picture for your collection and enter a caption describing the picture.\n\nIt's best to limit the caption to one or two words."
  24.  
  25. BACKSTOP
  26. PAGE
  27. WIZPIC wizpics\wizalbum.gif
  28. TYPE RADIOBUTTONS
  29. NAME GPCDnPictures
  30. DESCRIPTION How many pictures would you like to include in this picture collection display?
  31. ARGUMENT "&Three photos"@3@"wizpics\pix_3.gif"
  32. ARGUMENT "&Six photos"@6@"wizpics\pix_6.gif"
  33. ARGUMENT "N&ine photos"@9@"wizpics\pix_9.gif"
  34.  
  35. SET eval( nPicturesVar ) = GPCDnPictures
  36.  
  37. BACKSTOP
  38. PAGE
  39. WIZPIC wizpics\wizalbum.gif
  40. TYPE LIST
  41. NAME GPCDalbumStyle
  42. DESCRIPTION Choose from one of the styling selections below for your album.  This choice determines how the pages that contain the photo album page are decorated (both the `thumbnails' page and the individual picture pages).
  43. ARGUMENT "Photo memories"@1@"wizpics\photmem1.gif"
  44. ARGUMENT "Holiday memories"@2@"wizpics\holidmem.gif"
  45. ARGUMENT "Vacation photos"@3@"wizpics\vacatpho.gif"
  46. ARGUMENT "Party photos"@4@"wizpics\partypho.gif"
  47. ARGUMENT "Holiday photos"@5@"wizpics\hold2pho.gif"
  48. ARGUMENT "Just Photos (generic)"@6@"wizpics\genrcpho.gif"
  49. ARGUMENT "School Photos"@7@"wizpics\scholpho.gif"
  50. ARGUMENT "Fun Photos"@8@"wizpics\funphoto.gif"
  51.  
  52. SET eval( styleVar ) = GPCDalbumStyle
  53.  
  54. BACKSTOP
  55. SETTEMP nNumber = 1
  56. GOSUB GetEachPix
  57.  
  58. BACKSTOP
  59. SETTEMP nNumber = 2
  60. GOSUB GetEachPix
  61.  
  62. BACKSTOP
  63. SETTEMP nNumber = 3
  64. GOSUB GetEachPix
  65.  
  66. IF GPCDnPictures > 3
  67.   BACKSTOP
  68.   SETTEMP nNumber = 4
  69.   GOSUB GetEachPix
  70.  
  71.   BACKSTOP
  72.   SETTEMP nNumber = 5
  73.   GOSUB GetEachPix
  74.  
  75.   BACKSTOP
  76.   SETTEMP nNumber = 6
  77.   GOSUB GetEachPix
  78. ENDIF
  79.  
  80. IF GPCDnPictures > 6
  81.   BACKSTOP
  82.   SETTEMP nNumber = 7
  83.   GOSUB GetEachPix
  84.  
  85.   BACKSTOP
  86.   SETTEMP nNumber = 8
  87.   GOSUB GetEachPix
  88.  
  89.   BACKSTOP
  90.   SETTEMP nNumber = 9
  91.   GOSUB GetEachPix
  92. ENDIF
  93.  
  94. SETTEMP sectionCompleted = 1
  95.  
  96.  
  97. [GetEachPix]
  98. GOSUB Ordinal ;on call, nNumber contains pix#
  99.  
  100. SETTEMP enterPixVar = pictureNameRoot,nNumber
  101. SETTYPE eval( enterPixVar ) = normal
  102. SETTEMP temp = eval( enterPixVar )
  103. IF temp <> ""
  104.   SETTEMP enterpix = temp
  105. ELSE
  106.   SETTEMP enterpix = ""
  107. ENDIF
  108.  
  109. SETTEMP enterCaptionVar = pictureCaptionRoot,nNumber
  110. SETTEMP temp = eval( enterCaptionVar )
  111. IF temp <> ""
  112.   SETTEMP captiontext = temp
  113. ELSE
  114.   SETTEMP captiontext = ""
  115. ENDIF
  116.  
  117. PAGE
  118. NOSPELLCHECK
  119. WIZPIC wizpics\wizphoto.gif
  120. TYPE PICTUREANDCAPTION
  121. NAME enterpix
  122. PROMPT Pi&cture:
  123. ARGUMENT Capt&ion:@captiontext
  124. DESCRIPTION_RE pxprmpt1,ordinal,pxprmpt2
  125.  
  126. SETTEMP temp = modulepath( "x" )
  127. SETTYPE enterpix = normal
  128. SETTEMP temp2 = enterpix,"x"
  129.  
  130. IF enterpix = "" || temp2 = temp
  131.   MESSAGEBOX "You must choose a picture.  You cannot leave holes in the photo album.  Press OK to enter a valid picture."
  132.   GOTO GetEachPix
  133. ENDIF
  134.  
  135. SETTYPE enterpix = normal
  136. SET eval( enterPixVar ) = enterpix
  137. SET eval( enterCaptionVar ) = captiontext
  138.  
  139.  
  140.  
  141. ;xxxxxxxxxxxxxxxxxxxx  BUILD THUMBNAIL PAGE xxxxxxxxxxxxxxxxxxxxxxxxx
  142. [MakePhotoAlbumPages]
  143. ; prior to calling, set the following temporary variables
  144. ;  nPictures = number of pictures in album
  145. ;  albumStyle = style (1|2|3)
  146. ;  parentTopic = id of topic that is the parent topic of this album
  147. ;  albumTopic = name of VARIABLE to contain topic id of thumbnails page
  148. ;  pictureNameRoot = root of picture names, see example
  149. ;  pictureCaptionRoot = root of picture captions, see example
  150. ;  albumTitle = title for thumbnail page
  151. ;  photo_mode = "personal" or "news"
  152. ;  photoPageNameVar = root for names of page variables, used
  153. ;           to make sure that pages get replaced where appropriate
  154. ; for example,
  155. ;   SETTEMP parentTopic = pageNews
  156. ;   SETTEMP albumTopic = "newsAlbumTopicID"
  157. ;   SETTEMP nPictures = 3
  158. ;   SETTEMP pictureNameRoot = "newsPix"
  159. ;   SETTEMP pictureCaptionRoot = "newsPixText"
  160. ;   SETTEMP albumStyle = 1
  161. ;   SETTEMP photo_mode = "personal"
  162. ;   GOSUB MakePhotoAlbumPages
  163.  
  164. ; Build the thumbnail page first
  165. IF photo_mode <> "news"
  166.   SETTEMP prefix = "My "
  167. ELSE
  168.   SETTEMP prefix = ""
  169. ENDIF
  170.  
  171. IF albumStyle = 1
  172.  SETTEMP album_template = "Photo Memory Thumbnails - "
  173.  SETTEMP tit1 = prefix,"Photographic Memories"
  174.  SETTEMP ind_pix_template = "Photo Display Page"
  175. ENDIF
  176. IF albumStyle = 2 ;Christmas theme
  177.  SETTEMP album_template = "Holiday Thumbnails - "
  178.  SETTEMP tit1 = prefix,"Holiday Memories"
  179.  SETTEMP ind_pix_template = "Holiday Photo Page"
  180. ENDIF
  181. IF albumStyle = 3
  182.  SETTEMP album_template = "Vacation Thumbnails - "
  183.  SETTEMP tit1 = prefix,"Vacation Photos"
  184.  SETTEMP ind_pix_template = "Vacation Photo Page"
  185. ENDIF
  186. IF albumStyle = 4
  187.  SETTEMP album_template = "Party Thumbnails - "
  188.  SETTEMP tit1 = prefix,"Party Photos"
  189.  SETTEMP ind_pix_template = "Party Photo Display Page"
  190. ENDIF
  191. IF albumStyle = 5 ;Generic holiday
  192.  SETTEMP album_template = "Holiday 2 Thumbnails - "
  193.  SETTEMP tit1 = prefix,"Holiday Photos"
  194.  SETTEMP ind_pix_template = "Holiday 2 Photo Page"
  195. ENDIF
  196. IF albumStyle = 6 ;generic photos
  197.  SETTEMP album_template = "Photo Thumbnails - "
  198.  SETTEMP tit1 = prefix,"Photos"
  199.  SETTEMP ind_pix_template = "Photo2 Display Page"
  200. ENDIF
  201. IF albumStyle = 7
  202.  SETTEMP album_template = "School Thumbnails - "
  203.  SETTEMP tit1 = prefix,"School Photos"
  204.  SETTEMP ind_pix_template = "School Photo Display Page"
  205. ENDIF
  206. IF albumStyle = 8
  207.  SETTEMP album_template = "Fun Thumbnails - "
  208.  SETTEMP tit1 = prefix,"Fun Photos"
  209.  SETTEMP ind_pix_template = "Fun Photo Display Page"
  210. ENDIF
  211.  
  212. SET album_template = album_template,nPictures
  213.  
  214. IF photo_mode = "news"
  215.   SETTEMP tit2 = "The ",familyLastName," Family"
  216.   SETTEMP top_title =  tit1,": ",tit2
  217. ELSE
  218.   SETTEMP tit2 = name," ",familyLastName
  219.   SETTEMP top_title =  tit1,": ",tit2
  220. ENDIF
  221.  
  222. SETPARENTTOPIC parentTopic
  223.  
  224. SETTEMP GPCDnPictures = nPictures
  225. GOSUB SetupAlbumPictureVariables
  226.  
  227. SETTEMP photoPageName = "PhotoThumbnails",pictureNameRoot
  228.  
  229. ; build thumbnail page
  230. BUILDTOPIC photoPageName
  231. REPLACE eval( albumTopic )
  232. album_template    ;template
  233. none   ;backdrop
  234. 1      ;level
  235. 9      ;# links
  236. "##Photo1",pictureNameRoot
  237. "##Photo2",pictureNameRoot
  238. "##Photo3",pictureNameRoot
  239. "##Photo4",pictureNameRoot
  240. "##Photo5",pictureNameRoot
  241. "##Photo6",pictureNameRoot
  242. "##Photo7",pictureNameRoot
  243. "##Photo8",pictureNameRoot
  244. "##Photo9",pictureNameRoot
  245. 20        ;# fields
  246. top_title
  247. tit2
  248. pix1
  249. cap1
  250. pix2
  251. cap2
  252. pix3
  253. cap3
  254. pix4
  255. cap4
  256. pix5
  257. cap5
  258. pix6
  259. cap6
  260. pix7
  261. cap7
  262. pix8
  263. cap8
  264. pix9
  265. cap9
  266.  
  267. SET eval( albumTopic ) = topicfromsymbolic( photoPageName )
  268.  
  269. ; now build individual photo pages
  270.  
  271. SETTEMP GPCDnPictures = nPictures
  272. SETTEMP nNumber = 1
  273. GOSUB BuildIndPages
  274.  
  275.  
  276. ;xxxxxxxxxxxxxxxxx MAKE TOPICS FOR PHOTO PAGES xxxxxxxxxxxxxxxxxxxxxxxx
  277. [BuildIndPages]
  278. IF photo_mode <> ""
  279.   SETTEMP capVar = "cap",nNumber
  280.  
  281.   SETTEMP pixVar = "pix",nNumber
  282.   SETTYPE eval( pixVar ) = normal
  283.   SETTEMP thisPicture = eval( pixVar )
  284.   SETTEMP thisCaption = eval( capVar )
  285.  
  286.   SETSCALE thisPicture = 400 320
  287.   SETTYPE thisPicture = picture
  288.  
  289.   SETTEMP page_name = familyLastName," Photos: ",thisCaption
  290.   SETTEMP col_name = familyLastName,": Photo Collection"
  291. ELSE ;called to build empty page
  292.   SETTEMP page_name = "Unused Page"
  293. ENDIF
  294.  
  295. SETTEMP thisTopicName = "##Photo",nNumber,pictureNameRoot
  296.  
  297. SETPARENTTOPIC eval( albumTopic )
  298.  
  299. SETTEMP pageIDName = photoPageNameVar,nNumber
  300.  
  301. BUILDTOPIC thisTopicName
  302. REPLACE eval( pageIDName )
  303. ind_pix_template    ;template set previously
  304. none        ;backdrop
  305. 1           ;level
  306. 0           ;# links
  307. 4           ;# fields
  308. page_name
  309. thisPicture
  310. thisCaption
  311. col_name
  312.  
  313. SET eval( pageIDName ) = topicfromsymbolic( thisTopicName )
  314.  
  315. SETTEMP GPCDnPictures = subtract( GPCDnPictures 1 )
  316. SETTEMP nNumber = add( nNumber 1 )
  317.  
  318. IF GPCDnPictures <> 0
  319.   GOTO BuildIndPages
  320. ENDIF
  321.  
  322.  
  323.  
  324. [SetupAlbumPictureVariables]
  325. SETTEMP pixVar = pictureNameRoot,GPCDnPictures
  326. SETTEMP capVar = pictureCaptionRoot,GPCDnPictures
  327. SETTYPE eval( pixVar ) = normal
  328. SETTEMP eval( "pix",GPCDnPictures ) = eval( pixVar )
  329. SETTYPE eval( "pix",GPCDnPictures ) = picture
  330. SETSCALE eval( "pix",GPCDnPictures ) = 80 60
  331. SETTEMP eval( "cap",GPCDnPictures ) = eval( capVar )
  332. SETTEMP GPCDnPictures = subtract( GPCDnPictures 1 )
  333. IF GPCDnPictures <> 0
  334.   GOTO SetupAlbumPictureVariables
  335. ENDIF
  336.  
  337.  
  338. ;xxxxxxxxxxxxxxxxxxxxxxx ORDINAL - SET NUMBER WORDS xxxxxxxxxxxxxx
  339. [Ordinal]
  340. IF nNumber < 7
  341. IF nNumber = 1
  342. SETTEMP ordinal = "first"
  343. SETTEMP numeral = "one"
  344. ENDIF
  345. IF nNumber = 2
  346. SETTEMP ordinal = "second"
  347. SETTEMP numeral = "two"
  348. ENDIF
  349. IF nNumber = 3
  350. SETTEMP ordinal = "third"
  351. SETTEMP numeral = "three"
  352. ENDIF
  353. IF nNumber = 4
  354. SETTEMP ordinal = "fourth"
  355. SETTEMP numeral = "four"
  356. ENDIF
  357. IF nNumber = 5
  358. SETTEMP ordinal = "fifth"
  359. SETTEMP numeral = "five"
  360. ENDIF
  361. IF nNumber = 6
  362. SETTEMP ordinal = "sixth"
  363. SETTEMP numeral = "six"
  364. ENDIF
  365. ENDIF ; if nNumber<7
  366.  
  367. IF nNumber > 6
  368. IF nNumber = 7
  369. SETTEMP ordinal = "seventh"
  370. SETTEMP numeral = "seven"
  371. ENDIF
  372. IF nNumber = 8
  373. SETTEMP ordinal = "eighth"
  374. SETTEMP numeral = "eight"
  375. ENDIF
  376. IF nNumber = 9
  377. SETTEMP ordinal = "ninth"
  378. SETTEMP numeral = "nine"
  379. ENDIF
  380. IF nNumber = 10
  381. SETTEMP ordinal = "tenth"
  382. SETTEMP numeral = "ten"
  383. ENDIF
  384. IF nNumber = 11
  385. SETTEMP ordinal = "eleventh"
  386. SETTEMP numeral = "eleven"
  387. ENDIF
  388. IF nNumber = 12
  389. SETTEMP ordinal = "twelfth"
  390. SETTEMP numeral = "twelve"
  391. ENDIF
  392. ENDIF ; if nNumber>6
  393.  
  394. [InitPixVars]
  395. SETTEMP GPCDalbumStyle = ""
  396. SETTEMP GPCDnPictures = ""
  397. SETTEMP enterpix = ""
  398. SETTEMP captiontext = ""
  399.